package com.ctshk.task.worker.processors;

import com.ctshk.rpc.system.service.IScenicGetService;
import com.github.kfcfans.powerjob.worker.core.processor.ProcessResult;
import com.github.kfcfans.powerjob.worker.core.processor.TaskContext;
import com.github.kfcfans.powerjob.worker.core.processor.sdk.BasicProcessor;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Component;

/**
 * 爬虫任务---爬取景点资源
 */
@Slf4j
@Component
public class ScenicGetServiceProcessor implements BasicProcessor {

    @DubboReference
    private IScenicGetService scenicGetService;

    @Override
    public ProcessResult process(TaskContext context) throws Exception {
        scenicGetService.scenicTask(false, null, 0);
        return new ProcessResult(true, context + ": " + true);
    }
}
